Optimal. Leaf size=69 \[ \frac {a (B+i A) \tan (c+d x)}{d}-\frac {a (A-i B) \log (\cos (c+d x))}{d}-a x (B+i A)+\frac {i a B \tan ^2(c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.06, antiderivative size = 69, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {3592, 3525, 3475} \[ \frac {a (B+i A) \tan (c+d x)}{d}-\frac {a (A-i B) \log (\cos (c+d x))}{d}-a x (B+i A)+\frac {i a B \tan ^2(c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3525
Rule 3592
Rubi steps
\begin {align*} \int \tan (c+d x) (a+i a \tan (c+d x)) (A+B \tan (c+d x)) \, dx &=\frac {i a B \tan ^2(c+d x)}{2 d}+\int \tan (c+d x) (a (A-i B)+a (i A+B) \tan (c+d x)) \, dx\\ &=-a (i A+B) x+\frac {a (i A+B) \tan (c+d x)}{d}+\frac {i a B \tan ^2(c+d x)}{2 d}+(a (A-i B)) \int \tan (c+d x) \, dx\\ &=-a (i A+B) x-\frac {a (A-i B) \log (\cos (c+d x))}{d}+\frac {a (i A+B) \tan (c+d x)}{d}+\frac {i a B \tan ^2(c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.31, size = 70, normalized size = 1.01 \[ \frac {a \left ((-2 B-2 i A) \tan ^{-1}(\tan (c+d x))+2 (B+i A) \tan (c+d x)-2 (A-i B) \log (\cos (c+d x))+i B \tan ^2(c+d x)\right )}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.49, size = 109, normalized size = 1.58 \[ -\frac {2 \, {\left (A - 2 i \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} + 2 \, {\left (A - i \, B\right )} a + {\left ({\left (A - i \, B\right )} a e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, {\left (A - i \, B\right )} a e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (A - i \, B\right )} a\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}{d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.29, size = 194, normalized size = 2.81 \[ -\frac {A a e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - i \, B a e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 2 \, A a e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 2 i \, B a e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 2 \, A a e^{\left (2 i \, d x + 2 i \, c\right )} - 4 i \, B a e^{\left (2 i \, d x + 2 i \, c\right )} + A a \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - i \, B a \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 2 \, A a - 2 i \, B a}{d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.02, size = 110, normalized size = 1.59 \[ \frac {i a B \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}+\frac {i a A \tan \left (d x +c \right )}{d}+\frac {a B \tan \left (d x +c \right )}{d}+\frac {a \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) A}{2 d}-\frac {i a \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) B}{2 d}-\frac {i a A \arctan \left (\tan \left (d x +c \right )\right )}{d}-\frac {a B \arctan \left (\tan \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.86, size = 68, normalized size = 0.99 \[ -\frac {-i \, B a \tan \left (d x + c\right )^{2} - 2 \, {\left (d x + c\right )} {\left (-i \, A - B\right )} a - {\left (A - i \, B\right )} a \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - {\left (2 i \, A + 2 \, B\right )} a \tan \left (d x + c\right )}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 6.08, size = 59, normalized size = 0.86 \[ \frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (A\,a-B\,a\,1{}\mathrm {i}\right )}{d}+\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (B\,a+A\,a\,1{}\mathrm {i}\right )}{d}+\frac {B\,a\,{\mathrm {tan}\left (c+d\,x\right )}^2\,1{}\mathrm {i}}{2\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 0.54, size = 116, normalized size = 1.68 \[ - \frac {a \left (A - i B\right ) \log {\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} + \frac {- 2 i A a - 2 B a + \left (- 2 i A a e^{2 i c} - 4 B a e^{2 i c}\right ) e^{2 i d x}}{i d e^{4 i c} e^{4 i d x} + 2 i d e^{2 i c} e^{2 i d x} + i d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________